#ifndef VXLABEL_H
#define VXLABEL_H

#include <QtGui>


class VxLabelData : QObject
{
	Q_OBJECT

public:
	VxLabelData(QString caption, QVariant data) :
			_caption(caption), _data(data)
	{
	};

	QString getCaption()
	{
		return _caption;
	}

	void setData(QVariant data)
	{
		_data = data;
		emit dataChanged(_data);
	};

	QVariant getData()
	{
		return _data;
	};


private:
	QString _caption;
	QVariant _data;

signals:
	void dataChanged(QVariant data);

};



class VxLabel : public QWidget
{
	Q_OBJECT
public:
	VxLabel(VxLabelData * data, QWidget * parent=0);

	void setData(VxLabelData * data);

	VxLabelData * getData()
	{
		return _data;
	}

	QLabel * getLabel() const
	{
		return _label;
	}

	QLabel * getInfoLabel() const
	{
		return _info;
	}

	void setParent(QWidget *parent)
	{
		QWidget::setParent(parent);
	}


private:
	QLabel * _label;
	QLabel * _info;
	VxLabelData * _data;
	void _setStyleSheet();

protected:
	bool eventFilter(QObject *, QEvent *);

public slots:

	void showLabel();

	void hideLabel()
	{
		this->hide();
	}

};


#endif // VXLABEL_H
